<?php
error_reporting(0);
header('Content-Type: text/html; charset=utf-8');
session_start();
$adminusername = $_SESSION["adminusername"];
if ($adminusername == null) {
	echo "错误：登录超时，请<a href=login.php target=_parent>重新登录</a>！";
	exit;
} 

if(!defined('DDROOTPATH')){
    include_once('../comm/config.php');
}

function curPageURL($ui = "") {
	if (isset ($_SERVER['REQUEST_URI'])) {
		$uri = $_SERVER['REQUEST_URI'];
	} else {
		if (isset ($_SERVER['argv'])) {
			$uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['argv'][0];
		} else {
			$uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
		}
	}
	return "http://".$_SERVER ['HTTP_HOST'].$uri;
} 

$path=str_replace('http://'.URL.'/','',preg_replace('/\?(.*)/','',curPageURL()));
$path_arr=explode('/',$path);
if(count($path_arr)==3){
    $lujing='../';
	$u=$path_arr[1]."/".$path_arr[2];
}
else{
    $lujing='';
	$u=$path_arr[1];
}

$sql = "select m.url from " . $BIAOTOU . "access a," . $BIAOTOU . "menu m," . $BIAOTOU . "duoduo2010 d  where a.role_id=d.role_id and a.menu_id=m.id and d.adminname='" . $_SESSION["adminusername"] . "'";
$rs = mysql_query($sql);
while ($row = mysql_fetch_array($rs)) {
	$qxmlist[] = $row['url'];
} 
if(is_array($qxmlist)){
    foreach($qxmlist as $key => $rr) {
	    if ($u==$rr or strstr(curPageURL(),'sys_data_done.php')!='' or strstr(curPageURL(),'ReData.php')!='' or strstr(curPageURL(),'tao_dpgl_add_step2.php')!='' or strstr(curPageURL(),'top.php')!='') {
		    $qxor = true;
		    break;
	    } 
    } 
}
elseif(strstr(curPageURL(),'sys_data_done.php')!='' or strstr(curPageURL(),'ReData.php')!='' or strstr(curPageURL(),'tao_dpgl_add_step2.php')!='' or strstr(curPageURL(),'top.php')!='' or strstr(curPageURL(),'left.php')!=''  ){
    $qxor = true;
}

if (!$qxor) {
?>
<?php
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){?>
温馨提示：您对该页面没有操作权限
<?php }else {?>
<style>
#wrapper {
	position:absolute;
	left:50%;
	top:20%;
	width:454px;
	height:85px;
	padding:90px 17px;
	margin:-132px 0 0 -244px;
	text-align:center;
	font-size:12px;
	border:2px #CCCCCC solid;
}
#desc {
	height:45px;
	font-size:14px;
	font-weight:bold
}
#desc big {
	font-size:16px;
	color:#f00
}
#action {
	color:#666
}
</style>
  <div id="wrapper">
    <div id="desc">温馨提示：您对该页面没有操作权限</div>
  </div>
<?php }?> 
<?php 
exit;} 
?>